<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>部门列表</title>
    <script>
        function goPage(currentPage){
            document.getElementById("currentPage").value=currentPage;
            document.forms[0].submit();
        }
    </script>
</head>
<body>
<a href="/department/input">新增</a>

<!-- 查询的表单 -->
<form action="/department/list" method="post">
    <input type="hidden" name="currentPage" id="currentPage" value="1">


<table width="800px" cellpadding="0" cellspacing="0" align="center" border="1px">
    <tr>
        <td>ID</td>
        <td>名称</td>
        <td>缩写</td>
        <td>操作</td>
    </tr>
        <tr th:each="department:${PageInfo.list}">
            <td th:text="${department.id}"></td>
            <td th:text="${department.name}"></td>
            <td th:text="${department.sn}"></td>
            <td>
                <a th:href="|/department/delete?id=${department.id}|">删除</a>
                <a th:href="|/department/input?id=${department.id}|">修改</a>
            </td>
        </tr>

    <tr align="center">
        <td colspan="9">
            <a href="javascript:;" onclick="goPage(1);">首页</a>
            <a href="javascript:;" th:onclick="|goPage(${PageInfo.prePage})|">上一页</a>
            <a href="javascript:;" th:onclick="|goPage(${PageInfo.nextPage})|">下一页</a>
            <a href="javascript:;" th:onclick="|goPage(${PageInfo.pages})|">尾页</a>
            当前:<span th:text="${PageInfo.pageNum }"></span> / <span th:text="${PageInfo.pages }"></span>
            总条数:<span th:text="${PageInfo.total}"></span>
        </td>
    </tr>
</table>

</form>

</body>
</html>